.class public final Lcom/estrongs/android/taskmanager/a/b;
.super Landroid/widget/BaseAdapter;


# instance fields
.field private a:Landroid/view/LayoutInflater;

.field private b:Ljava/util/ArrayList;

.field private c:Lcom/estrongs/android/taskmanager/TaskManager;

.field private d:Landroid/content/res/ColorStateList;

.field private e:Ljava/util/HashMap;

.field private f:Ljava/util/HashMap;


# direct methods
.method public constructor <init>(Lcom/estrongs/android/taskmanager/TaskManager;Ljava/util/ArrayList;)V
    .locals 2

    const/4 v0, 0x0

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->d:Landroid/content/res/ColorStateList;

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->f:Ljava/util/HashMap;

    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->a:Landroid/view/LayoutInflater;

    iput-object p2, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    iput-object p1, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->clear()V

    :try_start_0
    invoke-virtual {p1}, Lcom/estrongs/android/taskmanager/TaskManager;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f020007

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;

    move-result-object v0

    invoke-virtual {p1}, Lcom/estrongs/android/taskmanager/TaskManager;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-static {v1, v0}, Landroid/content/res/ColorStateList;->createFromXml(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;)Landroid/content/res/ColorStateList;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->d:Landroid/content/res/ColorStateList;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method static synthetic a(Lcom/estrongs/android/taskmanager/a/b;)Lcom/estrongs/android/taskmanager/TaskManager;
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    return-object v0
.end method


# virtual methods
.method public a()Ljava/util/ArrayList;
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    return-object v0
.end method

.method public a(Landroid/view/View;IZ)V
    .locals 3

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lt p2, v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    invoke-virtual {v0, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/estrongs/android/taskmanager/b/a;

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/b/a;->f()Ljava/lang/String;

    move-result-object v0

    if-nez p1, :cond_1

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    invoke-static {p3}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    invoke-virtual {v1, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    :cond_1
    if-eqz p3, :cond_2

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    invoke-static {v1, v0}, Lcom/estrongs/android/taskmanager/TaskManager;->b(Landroid/content/Context;Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_2

    const v1, 0x7f02000e

    invoke-virtual {p1, v1}, Landroid/view/View;->setBackgroundResource(I)V

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    const/4 v2, 0x1

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    invoke-virtual {v1, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :goto_1
    invoke-virtual {p1}, Landroid/view/View;->invalidate()V

    goto :goto_0

    :cond_2
    const v1, -0xe0e0f

    invoke-virtual {p1, v1}, Landroid/view/View;->setBackgroundColor(I)V

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    const/4 v2, 0x0

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    invoke-virtual {v1, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_1
.end method

.method public a(Ljava/util/ArrayList;)V
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    iput-object p1, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    return-void
.end method

.method public a(Z)V
    .locals 1

    if-eqz p1, :cond_0

    invoke-virtual {p0}, Lcom/estrongs/android/taskmanager/a/b;->notifyDataSetChanged()V

    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->clear()V

    return-void
.end method

.method public getCount()I
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 6

    const/4 v4, 0x0

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/TaskManager;->a()Z

    move-result v0

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    invoke-virtual {v1}, Lcom/estrongs/android/taskmanager/TaskManager;->c()Z

    move-result v3

    if-eqz p2, :cond_0

    if-eqz v0, :cond_5

    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->a:Landroid/view/LayoutInflater;

    const v1, 0x7f03001c

    invoke-virtual {v0, v1, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    new-instance v1, Lcom/estrongs/android/taskmanager/a/e;

    invoke-direct {v1, v4}, Lcom/estrongs/android/taskmanager/a/e;-><init>(Lcom/estrongs/android/taskmanager/a/e;)V

    const v0, 0x7f0900be

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/a/e;->a:Landroid/widget/ImageView;

    const v0, 0x7f0900e1

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/a/e;->b:Landroid/widget/TextView;

    const v0, 0x7f0900e5

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/a/e;->d:Landroid/widget/ImageView;

    const v0, 0x7f0900e3

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/a/e;->e:Landroid/widget/ImageView;

    const v0, 0x7f0900e2

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/a/e;->f:Landroid/widget/LinearLayout;

    if-eqz v3, :cond_1

    const v0, 0x7f0900e4

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, v1, Lcom/estrongs/android/taskmanager/a/e;->c:Landroid/widget/TextView;

    iget-object v0, v1, Lcom/estrongs/android/taskmanager/a/e;->c:Landroid/widget/TextView;

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setVisibility(I)V

    :cond_1
    invoke-virtual {p2, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    move-object v2, v1

    :goto_0
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/taskmanager/a/b;->b:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/estrongs/android/taskmanager/b/a;

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/b/a;->f()Ljava/lang/String;

    move-result-object v4

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    invoke-static {v1, v4}, Lcom/estrongs/android/taskmanager/TaskManager;->b(Landroid/content/Context;Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_6

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->f:Ljava/util/HashMap;

    const/4 v5, 0x1

    invoke-static {v5}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v5

    invoke-virtual {v1, v4, v5}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_2
    :goto_1
    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    invoke-virtual {v1}, Ljava/util/HashMap;->size()I

    move-result v1

    if-lez v1, :cond_7

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    invoke-virtual {v1, v4}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_7

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->e:Ljava/util/HashMap;

    invoke-virtual {v1, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Boolean;

    invoke-virtual {v1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v1

    if-eqz v1, :cond_7

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->f:Ljava/util/HashMap;

    invoke-virtual {v1, v4}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_7

    const v1, 0x7f02000e

    invoke-virtual {p2, v1}, Landroid/view/View;->setBackgroundResource(I)V

    :goto_2
    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->a:Landroid/widget/ImageView;

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/b/a;->g()Landroid/graphics/drawable/Drawable;

    move-result-object v5

    invoke-virtual {v1, v5}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->b:Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/b/a;->i()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v1, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    if-nez v3, :cond_3

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/b/a;->c()Z

    move-result v1

    if-eqz v1, :cond_9

    :cond_3
    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->f:Landroid/widget/LinearLayout;

    const/4 v5, 0x0

    invoke-virtual {v1, v5}, Landroid/widget/LinearLayout;->setVisibility(I)V

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/b/a;->c()Z

    move-result v1

    if-eqz v1, :cond_8

    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->e:Landroid/widget/ImageView;

    const/4 v5, 0x0

    invoke-virtual {v1, v5}, Landroid/widget/ImageView;->setVisibility(I)V

    :goto_3
    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->f:Ljava/util/HashMap;

    invoke-virtual {v1, v4}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_a

    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->b:Landroid/widget/TextView;

    iget-object v4, p0, Lcom/estrongs/android/taskmanager/a/b;->d:Landroid/content/res/ColorStateList;

    invoke-virtual {v1, v4}, Landroid/widget/TextView;->setTextColor(Landroid/content/res/ColorStateList;)V

    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->a:Landroid/widget/ImageView;

    const v4, 0x77777777

    sget-object v5, Landroid/graphics/PorterDuff$Mode;->DST_IN:Landroid/graphics/PorterDuff$Mode;

    invoke-virtual {v1, v4, v5}, Landroid/widget/ImageView;->setColorFilter(ILandroid/graphics/PorterDuff$Mode;)V

    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->d:Landroid/widget/ImageView;

    const v4, 0x7f02003f

    invoke-virtual {v1, v4}, Landroid/widget/ImageView;->setImageResource(I)V

    :goto_4
    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->d:Landroid/widget/ImageView;

    new-instance v4, Lcom/estrongs/android/taskmanager/a/c;

    invoke-direct {v4, p0, p1}, Lcom/estrongs/android/taskmanager/a/c;-><init>(Lcom/estrongs/android/taskmanager/a/b;I)V

    invoke-virtual {v1, v4}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v1, v0, Lcom/estrongs/android/taskmanager/b/a;->b:Lcom/estrongs/android/taskmanager/b/i;

    if-eqz v1, :cond_4

    if-eqz v3, :cond_4

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/b/a;->d()Lcom/estrongs/android/taskmanager/b/i;

    move-result-object v0

    if-nez v0, :cond_b

    iget-object v0, v2, Lcom/estrongs/android/taskmanager/a/e;->c:Landroid/widget/TextView;

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    const v3, 0x7f07000e

    invoke-virtual {v1, v3}, Lcom/estrongs/android/taskmanager/TaskManager;->getText(I)Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    :goto_5
    iget-object v0, v2, Lcom/estrongs/android/taskmanager/a/e;->c:Landroid/widget/TextView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V
    :try_end_0
    .catch Ljava/lang/IndexOutOfBoundsException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_1

    :cond_4
    :goto_6
    return-object p2

    :cond_5
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/estrongs/android/taskmanager/a/e;

    move-object v2, v0

    goto/16 :goto_0

    :cond_6
    :try_start_1
    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->f:Ljava/util/HashMap;

    invoke-virtual {v1, v4}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    iget-object v1, p0, Lcom/estrongs/android/taskmanager/a/b;->f:Ljava/util/HashMap;

    invoke-virtual {v1, v4}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    goto/16 :goto_1

    :catch_0
    move-exception v0

    goto :goto_6

    :cond_7
    const v1, -0xe0e0f

    invoke-virtual {p2, v1}, Landroid/view/View;->setBackgroundColor(I)V

    goto/16 :goto_2

    :catch_1
    move-exception v0

    goto :goto_6

    :cond_8
    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->e:Landroid/widget/ImageView;

    const/16 v5, 0x8

    invoke-virtual {v1, v5}, Landroid/widget/ImageView;->setVisibility(I)V

    goto :goto_3

    :cond_9
    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->f:Landroid/widget/LinearLayout;

    const/16 v5, 0x8

    invoke-virtual {v1, v5}, Landroid/widget/LinearLayout;->setVisibility(I)V

    goto :goto_3

    :cond_a
    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->b:Landroid/widget/TextView;

    const/high16 v4, -0x100

    invoke-virtual {v1, v4}, Landroid/widget/TextView;->setTextColor(I)V

    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->a:Landroid/widget/ImageView;

    const/4 v4, 0x0

    invoke-virtual {v1, v4}, Landroid/widget/ImageView;->setColorFilter(Landroid/graphics/ColorFilter;)V

    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->d:Landroid/widget/ImageView;

    const v4, 0x7f02003f

    invoke-virtual {v1, v4}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_4

    :cond_b
    iget-object v1, v2, Lcom/estrongs/android/taskmanager/a/e;->c:Landroid/widget/TextView;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v4, p0, Lcom/estrongs/android/taskmanager/a/b;->c:Lcom/estrongs/android/taskmanager/TaskManager;

    const v5, 0x7f07000e

    invoke-virtual {v4, v5}, Lcom/estrongs/android/taskmanager/TaskManager;->getText(I)Ljava/lang/CharSequence;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v0, v0, Lcom/estrongs/android/taskmanager/b/i;->g:Ljava/lang/String;

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    :try_end_1
    .catch Ljava/lang/IndexOutOfBoundsException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/NullPointerException; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_5
.end method
